package date.Exa5;

import java.time.*;

/**
 * 时区时间API学习
 */
public class ZonedTimeStudy {

    public static void main(String[] args) {
        ZonedDateTime apollo = ZonedDateTime.of(1969,7,16,9,32,0,0, ZoneId.of("Asia/Shanghai"));
        System.out.println("apollo : "+apollo);

        Instant instant = apollo.toInstant();
        System.out.println("instant :"+instant);

        ZonedDateTime zonedDateTime = instant.atZone(ZoneId.of("UTC"));
        System.out.println("zonedDateTime "+zonedDateTime);

        ZonedDateTime skipped = ZonedDateTime.of(LocalDate.of(2013,3,31), LocalTime.of(2,30),ZoneId.of("Asia/Shanghai"));
        System.out.println("skipped : "+skipped);
        skipped = skipped.plusHours(5);
        System.out.println(skipped);

    }
}
